Programming A Pendulum In Python